package com.kclmedu.eurekaclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/*************************
 *@ClassName HiController
 *@Description 一个简单的控制器
 *@Author yejf
 *@Date 2019-11-30 14:13
 *@Version 1.0
 */

@RestController
public class HiController {

    @Value("${server.port}")
    private String port;

    @RequestMapping("/hi")
    public String home(@RequestParam(value = "name",defaultValue = "yejf") String name) {
        //以返回值做为响应体
        return "Hi,"+name+", I am from port: "+port;
    }
}
